﻿using System;
using System.Collections.Generic;

namespace Models
{
    /// <summary>
    /// 交往记录表
    /// </summary>
    public class Activitys
    {
        [Key]
        public Int32? ActID { get; set; }//交往ID
        public String CusID { get; set; }//客户编号
        public DateTime? ActDate { get; set; }//交往时间
        public String ActAdd { get; set; }// 交往地点
        public String ActTitle { get; set; }//概要
        public String ActMemo { get; set; }//备注
        public String ActDesc { get; set; }//详细信息

    }
    /// <summary>
    /// 销售机会表
    /// </summary>
    public class Chances
    {
        [Key]
        public Int32? ChanID { get; set; }//销售机会ID
        public String ChanName { get; set; }//客户名称
        public Int32? ChanRate { get; set; }//成功几率
        public String ChanLinkMan { get; set; }//联系人
        public String ChanLinkTel { get; set; }//联系电话
        public String ChanTitle { get; set; }//概要
        public String ChanDesc { get; set; }//机会描述
        public Int32? ChanCreateMan { get; set; }//创建人
        public DateTime? ChanCreateDate { get; set; }//创建时间
        public Int32? ChanDueMan { get; set; }//指派人
        public DateTime? ChanDueDate { get; set; }//指派时间
        public Int32? ChanState { get; set; }//销售机会状态
        public String ChanError { get; set; }//失败原因

    }
    /// <summary>
    /// 客户信息
    /// </summary>
    public class Customers
    {
        [Key]
        public Int32? ID { get; set; }//自动增加编号
        public Int32? UserID { get; set; }//客户经理编号
        public String CusID { get; set; }//客户编号
        public String CusName { get; set; }//客户姓名
        public String CusAddress { get; set; }//地址
        public String CusZip { get; set; }//邮编
        public String CusFax { get; set; }// 传真
        public String CusWebsite { get; set; }//网址
        public String CusLicenceNo { get; set; }//营业执照注册号
        public String CusChieftain { get; set; }//法人
        public Int32? CusBankroll { get; set; }//注册资金
        public Int32? CusTurnover { get; set; }//年营业额
        public String CusBank { get; set; }//开户银行
        public String CusBankNo { get; set; }//银行账号
        public String CusLocalTaxNo { get; set; }//地税登记号
        public String CusNationalTaxNo { get; set; }//国税登记号
        public DateTime? CusDate { get; set; }//建立时间
        public Int32? CusState { get; set; }//客户状态

    }
    /// <summary>
    /// 客户流失表
    /// </summary>
    public class CustomLosts
    {
        [Key]
        public Int32? CLID { get; set; }//客户流失ID
        public String CusID { get; set; }//客户编号
        public DateTime? CLOrderDate { get; set; }//最后下单时间
        public DateTime? CLDate { get; set; }//流失报警时间
        public DateTime? CLEnterDate { get; set; }//确定流失时间
        public String CLReason { get; set; }//流失原因
        public Int32? CLState { get; set; }//状态
        public Int32? ChanID { get; set; }

    }
    /// <summary>
    /// 客户服务处理
    /// </summary>
    public class CustomServices
    {
        [Key]
        public Int32? CSID { get; set; }//客户服务处理ID
        public Int32? STID { get; set; }//服务类型ID
        public String CusID { get; set; }//客户编号
        public String CSTitle { get; set; }//概要
        public Int32? CSState { get; set; }//服务状态
        public String CSDesc { get; set; }//服务请求
        public Int32? CSCreateID { get; set; }//创建人ID
        public DateTime? CSCreateDate { get; set; }//创建时间
        public Int32? CSDueID { get; set; }//指派人ID
        public DateTime? CSDueDate { get; set; }//指派时间
        public String CSDeal { get; set; }//服务处理
        public DateTime? CSDealDate { get; set; }//处理时间
        public String CSResult { get; set; }//处理结果
        public Int32? CSSatisfy { get; set; }//满意度
        public String CSName { get; set; }//客户名称

    }
    /// <summary>
    /// 联系人
    /// </summary>
    public class LinkMans
    {
        [Key]
        public Int32? LMID { get; set; }//联系人编号
        public String CusID { get; set; }//客户编号
        public String LMName { get; set; }//姓名
        public String LMSex { get; set; }//性别
        public String LMDuty { get; set; }//职位
        public String LMMobileNo { get; set; }//手机号码
        public String LMOfficeNo { get; set; }//办公室号码
        public String LMMemo { get; set; }//备注

    }
    /// <summary>
    /// 流失措施表
    /// </summary>
    public class Measures
    {
        [Key]
        public Int32? MeID { get; set; }//编号
        public Int32? CLID { get; set; }//客户流失ID 
        public DateTime? MeDate { get; set; }//创建时间
        public String MeDesc { get; set; }//措施细节

    }
    
    /// <summary>
    /// 订单表
    /// </summary>
    public class Orders
    {
        [Key]
        public Int32? OrderID { get; set; }//订单编号
        public String CusID { get; set; }//客户编号
        public DateTime? OrderDate { get; set; }//订购时间

    }
    /// <summary>
    /// 销售计划表 
    /// </summary>
    public class Plans
    {
        [Key]
        public Int32? PlanID { get; set; }//计划ID 
        public Int32? ChanID { get; set; }//销售机会ID 
        public DateTime? PlanDate { get; set; }//计划时间
        public String PlanContent { get; set; }//计划内容
        public DateTime? PlanResultDate { get; set; }//执行时间 
        public String PlanResult { get; set; }//执行结果

    }
    /// <summary>
    /// 服务类型
    /// </summary>
    public class ServiceType
    {
        [Key]
        public Int32? STID { get; set; }//服务类型ID 
        public String STName { get; set; }//服务类型名称

    }
    
    /// <summary>
    /// 用户关联表
    /// </summary>
    public class V_ShiYong//Chances
    {
        [Key]
        public Int32? ChanID { get; set; }
        public Int32? ChanState { get; set; }
        public String ChanName{ get; set; }
        public String ChanTitle{ get; set; }
        public String ChanLinkMan { get; set; }
        public String ChanLinkTel{ get; set; }
        public String UserName{ get; set; }
        public DateTime? ChanCreateDate { get; set; }

    }
    /// <summary>
    /// 销售机会试图
    /// </summary>
    public class V_Chances
    {
        [Key]
        public Int32? ChanID { get; set; }//销售机会ID
        public String ChanName { get; set; }//客户名称
        public Int32? ChanRate { get; set; }//成功几率
        public String ChanLinkMan { get; set; }//联系人
        public String ChanLinkTel { get; set; }//联系电话
        public String ChanTitle { get; set; }//概要
        public String ChanDesc { get; set; }//机会描述
        public Int32? ChanCreateMan { get; set; }//创建人
        public DateTime? ChanCreateDate { get; set; }//创建时间
        public Int32? ChanDueMan { get; set; }//指派人
        public DateTime? ChanDueDate { get; set; }//指派时间
        public Int32? ChanState { get; set; }//销售机会状态
        public String ChanError { get; set; }//失败原因
        public String ChanCreateName { get; set; }//创建人
        public String ChanDueName { get; set; }//分派人
        public String StateString { get; set; }//销售机会状态

    }
    /// <summary>
    /// 客户服务处理试图
    /// </summary>
    public class V_ServiceType
    {
        [Key]
        public Int32? CSID { get; set; }//客户服务处理ID
        public String CSName { get; set; }//客户名称
        public Int32? STID { get; set; }//服务类型ID
        public String CusID { get; set; }//客户编号
        public String CSTitle { get; set; }//概要
        public Int32? CSState { get; set; }//服务状态
        public String CSDesc { get; set; }//服务请求
        public Int32? CSCreateID { get; set; }//创建人ID
        public DateTime? CSCreateDate { get; set; }//创建时间
        public Int32? CSDueID { get; set; }//指派人ID
        public DateTime? CSDueDate { get; set; }//指派时间
        public String CSDeal { get; set; }//服务处理
        public DateTime? CSDealDate { get; set; }//处理时间
        public String CSResult { get; set; }//处理结果
        public Int32? CSSatisfy { get; set; }//满意度
        public String STName { get; set; }//服务类型
        public String ChanName { get; set; }//客户名称//V_Customers
        public String CSCreateName { get; set; }
        public String CSDueName { get; set; }

    }
    //客户名称试图
    public class V_Customers 
    {
        [Key]
        public Int32? ChanID { get; set; }//服务类型ID
        public String ChanName { get; set; }//客户编号
        public Int32? ID { get; set; }
        public String CusID { get; set; }//概要
    }
    /// <summary>
    /// 客户信息试图表
    /// </summary>
    public class VV_Customers
    {
        [Key]
        public Int32? ID { get; set; }
        public String CusID { get; set; }//客户编号
        public Int32? UserID { get; set; }//客户经理编号
        public String CusName { get; set; }//客户名称
        public String CusAddress { get; set; }//地址
        public String CusZip { get; set; }//邮编
        public String CusFax { get; set; }// 传真
        public String CusWebsite { get; set; }//网址
        public String CusLicenceNo { get; set; }//营业执照注册号
        public String CusChieftain { get; set; }//法人
        public Int32? CusBankroll { get; set; }//注册资金
        public Int32? CusTurnover { get; set; }//年营业额
        public String CusBank { get; set; }//开户银行
        public String CusBankNo { get; set; }//银行账号
        public String CusLocalTaxNo { get; set; }//地税登记号
        public String CusNationalTaxNo { get; set; }//国税登记号
        public DateTime? CusDate { get; set; }//建立时间
        public Int32? CusState { get; set; }//客户状态
        public String CusMan { get; set; }//客户经理

    }
    /// <summary>
    /// 客户流失试图
    /// </summary>
    public class VV_CustomLosts
    {
        [Key]
        public Int32? CLID { get; set; }//客户流失ID
        public String CusID { get; set; }//客户编号
        public DateTime? CLOrderDate { get; set; }//最后下单时间
        public DateTime? CLDate { get; set; }//流失报警时间
        public DateTime? CLEnterDate { get; set; }//确定流失时间
        public String CLReason { get; set; }//流失原因
        public Int32? CLState { get; set; }//状态
        public String CusName { get; set; }//客户名称

    }
    /// <summary>
    /// 用户表
    /// </summary>
    public class Users
    {
        [Key]
        public Int32? UserID { get; set; }//用户编号
        public Int32? RoleID { get; set; }//角色ID
        public String UserLName { get; set; }//登录名
        public String UserLPWD { get; set; }//登录密码
        public String UserName { get; set; }//真实姓名


    }
    /// <summary>
    /// 菜单表
    /// </summary>
    public class Menu
    {
        [Key]
        public Int32? ID { get; set; }//菜单ID
        public String MenuName { get; set; }//权限名称
        public String URL { get; set; }//权限路径
        public Int32? ParentID { get; set; }//权限的大ID

    }
    /// <summary>
    /// 管理员表
    /// </summary>
    public class Role
    {
        [Key]
        public Int32? ID { get; set; }//管理ID
        public String RoleName { get; set; }//管理员职务名称
    }
    public class RolePowers
    {
        [Key]
        public System.Int32? ID { get; set; }
        public System.Int32? RoleID { get; set; }
        public System.Int32? MenuID { get; set; }

    }
    public class Powers
    {
        [Key]
        public System.Int32? ID { get; set; }
        public System.String MenuName { get; set; }
        public System.String URL { get; set; }
        public System.Int32? ParentID { get; set; }
        public System.Boolean? Checked { get; set; }

    }
    public class V_Users
    {
        [Key]
        public System.Int32? UserID { get; set; }
        public System.Int32? RoleID { get; set; }
        public System.String UserLName { get; set; }
        public System.String UserLPWD { get; set; }
        public System.String UserName { get; set; }
        public System.String RoleName { get; set; }
    }

    /// <summary>
    /// 菜单实体类
    /// </summary>
    public class MenuV2 : Menu
    {
        /// <summary>
        /// 子菜单集合
        /// </summary>
        public List<MenuV2> SubMenus { get; set; }

        /// <summary>
        /// 是否拥有此权限
        /// </summary>
        public bool Checked { get; set; }
    }

}